<?php include 'CheckSession.php'; ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>网站配置</title>
    <link href="css/style.css" rel="stylesheet" type="text/css"/>
</head>

<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td height="50" align="center" class="title">网站配置</td>
    </tr>
</table>

<?php
$con = mysql_connect("localhost", "root", "");
if (!$con) {
    die('Could not connect: ' . mysql_error());
}

// Create table in my_db database
mysql_select_db("my_db", $con);
$sql = "SELECT * FROM `SiteConfig`";
$result = mysql_query($sql, $con);
$row = mysql_fetch_array($result);
mysql_close($con);
?>
<div style="text-align:left; margin-top:10px;margin-left:50px">
    <fieldset style="width:50%;">
        <legend>网站配置</legend>
        <br>

        <form name="form1" action="updateconfig.php" method="post">
            <table width="100%" border="0" align="center" cellpadding="10" cellspacing="0" bordercolorlight="#FFFFFF"
                   bordercolordark="#CCCCCC">
                <tr>
                    <td width="18%" align="right" nowrap>网站标题：</td>
                    <td width="82%"><input name="title" type="text" class="inputtext" style="width:100%"
                                           value=" <?php echo $row['title'] ?>"></td>
                </tr>
                <tr>
                    <td width="18%" align="right" nowrap>网站描述：</td>
                    <td width="82%"><input name="description" type="text" class="inputtext" id="desc" style="width:100%"
                                           value="<?php echo $row['description'] ?>"></td>
                </tr>
                <tr>
                    <td width="18%" align="right" nowrap>关键字：</td>
                    <td width="82%"><input name="keyword" type="text" class="inputtext" id="key" style="width:100%"
                                           value="<?php echo $row['keyword'] ?>"></td>
                </tr>
                <tr>
                    <td width="18%" align="right" nowrap>网址：</td>
                    <td width="82%"><input name="url" type="text" class="inputtext" id="url" style="width:100%"
                                           value="<?php echo $row['url'] ?>"></td>
                </tr>
                <tr>
                    <td width="18%" align="right" nowrap>联系电话：</td>
                    <td width="82%"><input name="qq" type="text" class="inputtext" id="qq" style="width:100%"
                                           value="<?php echo $row['qq'] ?>"></td>
                </tr>
                <tr>
                    <td width="18%" align="right" nowrap>在线支付参数：</td>
                    <td width="82%"></td>
                </tr>
                <tr>
                    <td width="18%" align="right" nowrap>支付网址：</td>
                    <td width="82%"><input name="purl" type="text" class="inputtext" id="purl" style="width:100%"
                                           value="<?php echo $row['purl'] ?>"></td>
                </tr>
                <tr>
                    <td width="18%" align="right" nowrap>商户号：</td>
                    <td width="82%"><input name="pid" type="text" class="inputtext" id="pid" style="width:100%"
                                           value="<?php echo $row['pid'] ?>"></td>
                </tr>
                <tr>
                    <td width="18%" align="right" nowrap>密钥：</td>
                    <td width="82%"><input name="pkey" type="text" class="inputtext" id="pkey" style="width:100%"
                                           value="<?php echo $row['pkey'] ?>"></td>
                </tr>
                <tr>
                    <td height="40" colspan="2" align="center" valign="bottom" nowrap>
                        <input name="Submit" type="Submit" class="button" value="确认">
                        &nbsp;&nbsp;&nbsp;&nbsp;
                        <input name="Submit2" type="reset" class="button" value="重置"></td>
                </tr>
            </table>
        </form>
    </fieldset>
</div>
<br>
</body>
</html>
